<?php
$builder = $this->maintenance->builder;
$db = $this->db;
$builder->db = $this->db;
$tabs = $db->query_select('cllg_table_tab', "TABLE_NAME='cllg_student'");
?>
<form id="<?php echo FORM_NAME; ?>" name="<?php echo FORM_NAME; ?>" method="post" action="<?php echo CORE_PATH; ?>" >
    <input type="hidden" id="module" name="module" value="<?php echo $this->instanceName; ?>" />
    <div id="mant_head" class="ui-widget-content ui-corner-all">
        <div id="titulo">Mantenimiento Alumnos</div>
        <div id="botones">
            <button id="cmdOk" type="button" onclick="doSubmit('operation=s')">
                <img alt="Guardar"  src="imgv2/actions/document-save.png" />
            </button>
            <button id="cmdCancel" type="button"  onclick="doSubmit('')">
                <img alt="Cancelar"  src="imgv2/actions/window-close.png" /></button>
        </div>
    </div>
    <div id="tabs">
        <ul>
            <li><a href="#tab1">INFORMACION PRINCIPAL</a></li>
            <?php
            $ix = 0;
            foreach ($tabs as $t) {
                $ix++;
                $tabId = "_tab_" . $ix;
                ?>
                <li ><a href="#<?php echo $tabId; ?>"><?php echo $t["CAPTION"]; ?></a></li>
            <?php } ?>
        </ul>
        <div class="form-container" id="tab1">
            <fieldset>
                <div>
                    <label for="ID"> * No. Carnet</label>
                    <input name="ID" type="text" id="ID" />
                </div>
                <div>
                    <label for="FIRST_NAME"> * Nombres: </label>
                    <input name="FIRST_NAME" type="text" value="" id="FIRST_NAME" size="60" maxlength="100" />

                </div>
                <div>
                    <label for="LAST_NAME"> * Apellidos:</label>
                    <input name="LAST_NAME"  type="text" id="LAST_NAME" size="60" maxlength="100" />
                </div>
                <div>
                    <label for="GENDER"> * Sexo:</label>
                    <select name="GENDER" size="1" id="GENDER">
                        <option value="M">Masculino</option>
                        <option value="F">Femenino</option>
                    </select>
                </div>
                <div>
                    <label for="BIRTH_DATE">Fecha de Nacimiento</label>
                    <input name="BIRTH_DATE" type="text" id="BIRTH_DATE" />
                </div>
                <div>
                    <label for="EDAD">Edad</label>
                    <input name="EDAD"  type="text" id="EDAD" />
                </div>
                <div>
                    <label for="EMAIL">Correo Electr&oacute;nico</label>
                    <input name="EMAIL" type="text" id="EMAIL" />
                </div>
                <div>
                    <label for="PICTUREPATH">*Fotografia:</label>
                    <div  class="specialarea">
                        <a id="cargarFoto" href="<?php echo CORE_PATH; ?>?module=<?PHP ModUploader::$INSTANCE_NAME ?>&op=uploader">Cambiar</a>
                        <div id="nuevafoto"></div>
                    </div>

                </div>
                <input name="PICTURE_PATH" type="hidden" id="PICTURE_PATH" value="1" />
                <input name="TMP_PIC" type="hidden" id="TMP_PIC" value="1" />
                <input name="STATUS" type="hidden" id="STATUS" value="1" />
                <input name="operation" type="hidden" id="operation" value="s" />
            </fieldset>
        </div>
        <?php
        $ix = 0;
        foreach ($tabs as $t) {
            $ix++;
            ?>
            <div class="form-container" id="_tab_<?php echo $ix; ?>">
                <fieldset>
                    <?php
                    $builder->build("cllg_student", NULL, $t['ID']);
                    ?>
                </fieldset>
            </div>
<?php } ?>
    </div>
</form>
<script type="text/javascript">
    jQuery("#tabs").tabs();
</script>